<?php
/************************
 *  Codenova.pl Project
 *  Created by: Kamil Mrzygłód
 *
 *  (c) 2013 by Codenova.pl
 *  All Right Reserved
 ***********************/

namespace Gotcha\App\Extensions;

// Gotcha routing extension

use Gotcha\App\Types\String;

final class HttpExtension {
    public function resolveAbsoluteUrl() {
        // Since REQUEST_URI gives us something like
        // /url/ and saved route path /url we have
        // to get rid of additional /
        //$requestWithoutSlash = new String(substr($_SERVER['REQUEST_URI'], 0, -1));
        $requestWithoutSlash = '';
        return new String('http://'.$_SERVER['HTTP_HOST'].$requestWithoutSlash);
    }
}